DROP TABLE IF EXISTS jms_ods.yl_tmsnew_branch_shipment_stop;   
CREATE EXTERNAL TABLE jms_ods.yl_tmsnew_branch_shipment_stop(   
 ID bigint comment "经停点编码",  --NUMBER(20)
 SHIPMENT_ID bigint comment "任务ID",  --NUMBER(20)
 SHIPMENT_NO string comment "任务编号",  --NVARCHAR2(30)
 SORT_NUM bigint comment "顺序编号",  --NUMBER(11)
 NETWORK_ID bigint comment "经停网点ID",  --NUMBER(11)
 NETWORK_CODE string comment "经停网点编号",  --NVARCHAR2(30)
 NETWORK_NAME string comment "经停网点名称",  --NVARCHAR2(50)
 ROADSECTION_ID bigint comment "路段编号",  --NUMBER(11)
 PLANNED_ARRIVAL_DAY string comment "计划到达日期",  --NVARCHAR2(20)
 PLANNED_ARRIVAL_HOUR string comment "计划到达时间",  --NVARCHAR2(5)
 PLANNED_ARRIVAL_TIME timestamp comment "计划到达日期+时间",  --DATE
 ACTUAL_ARRIVAL_TIME timestamp comment "实际到达时间",  --DATE
 PLANNED_DEPARTURE_DAY string comment "计划离开日期",  --NVARCHAR2(20)
 PLANNED_DEPARTURE_HOUR string comment "计划离开时间",  --NVARCHAR2(5)
 PLANNED_DEPARTURE_TIME timestamp comment "计划离开日期+时间",  --DATE
 ACTUAL_DEPARTURE_TIME timestamp comment "实际离开时间",  --DATE
 STOP_TIME bigint comment "经停时长",  --NUMBER(11)
 USETIME bigint comment "运输耗时(MIN)",  --NUMBER(11)
 MILEAGE double comment "规划里程(KM)",  --NUMBER
 SPEED double comment "时速(KM/H)",  --NUMBER
 BATCH_TIME string comment "批次时间",  --NVARCHAR2(50)
 HANDLING_TYPE string comment "装卸类型",  --NVARCHAR2(20)
 LOAD_START_TIME timestamp comment "开始装货",  --DATE
 LOAD_END_TIME timestamp comment "装货完成",  --DATE
 UNLOAD_START_TIME timestamp comment "开始卸货",  --DATE
 UNLOAD_END_TIME timestamp comment "卸货完成",  --DATE
 APP_ARRIVAL_TIME timestamp comment "APP到达时间",  --DATE
 APP_DEPARTURE_TIME timestamp comment "APP离开时间",  --DATE
 GPS_ARRIVAL_TIME timestamp comment "GPS到达时间",  --DATE
 GPS_DEPARTURE_TIME timestamp comment "GPS离开时间",  --DATE
 LOCK_TIME timestamp comment "锁车时间",  --DATE
 UNLOCK_TIME timestamp comment "解锁时间",  --DATE
 WEIGHT_ARRIVAL_TIME timestamp comment "过磅进站时间",  --DATE
 WEIGHT_DEPARTURE_TIME timestamp comment "过磅出站时间",  --DATE
 ARRIVAL_GROSS_WEIGHT double comment "到达毛重",  --NUMBER
 ARRIVAL_TARE_WEIGHT double comment "到达皮重",  --NUMBER
 ARRIVAL_NET_WEIGHT double comment "到达净重",  --NUMBER
 DEPARTURE_GROSS_WEIGHT double comment "离开毛重",  --NUMBER
 DEPARTURE_TARE_WEIGHT double comment "离开皮重",  --NUMBER
 DEPARTURE_NET_WEIGHT double comment "离开净重",  --NUMBER
 ESTIMATE_ARRIVAL_TIME timestamp comment "预计到达时间=上一站实际发车时间+本站运输耗时(MIN)",  --DATE
 PLAN_DRIVING_TIME bigint comment "规定行驶时间",  --NUMBER(11)
 ACTUAL_DRIVING_TIME bigint comment "实际行驶时间",  --NUMBER(11)
 ACTUAL_ARRIVAL_TIME_SOURCE string comment "实际进站时间来源",  --NVARCHAR2(30)
 ACTUAL_DEPARTURE_TIME_SOURCE string comment "实际出站时间来源",  --NVARCHAR2(30)
 ESTIMATE_BATCH_TIME timestamp comment "应赶批次",  --DATE
 ACTUAL_BATCH_TIME timestamp comment "实赶批次时间",  --DATE
 CREATE_BY bigint comment "创建人ID",  --NUMBER(11)
 CREATE_BY_NAME string comment "创建人姓名",  --NVARCHAR2(100)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 UPDATE_BY bigint comment "更新人ID",  --NUMBER(11)
 UPDATE_BY_NAME string comment "更新人姓名",  --NVARCHAR2(100)
 UPDATE_TIME timestamp comment "更新时间",  --DATE
 SIMPLE_NAME string comment "网点简称",  --NVARCHAR2(20)
 GPS_DEPART_MILEAGE double comment "GPS发车里程",  --NUMBER(15,5)
 GPS_ARRIVAL_MILEAGE double comment "GPS到车里程",  --NUMBER(15,5)
 FINANCIAL_CENTER_ID bigint comment "代理区ID",  --NUMBER(11)
 FINANCIAL_CENTER_CODE string comment "代理区CODE",  --NVARCHAR2(30)
 FINANCIAL_CENTER_DESC string comment "代理区名称",  --NVARCHAR2(60)
 CLOCK_TIME timestamp comment "中心签到时间"  --DATE
 )     
 COMMENT '支线任务经停表'    
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)') 
 STORED AS PARQUET   
 LOCATION '/dw/hive/jms_ods.db/external/yl_tmsnew_branch_shipment_stop'    
 TBLPROPERTIES (    
 'discover.partitions'='false',   
 'parquet.column.index.access'='true'   
 );     
     
MSCK REPAIR TABLE jms_ods.yl_tmsnew_branch_shipment_stop;   